﻿package com.tvein.system
{
	//flash
	//pureMVC
	import org.puremvc.as3.multicore.patterns.facade.Facade;
	import org.puremvc.as3.multicore.interfaces.IFacade;
	//custom
	import com.tvein.System;
	import com.tvein.system.controller.StartupCommand;
//
	public class ApplicationFacade extends Facade implements IFacade
	{
	 	public static const STARTUP : String = "startup";
		
	 	public function ApplicationFacade (key:String)
	 	{
	 		super(key);
	 	} 

		public static function getInstance(key:String) : ApplicationFacade
		{
            if (instanceMap[key] == null) instanceMap[key] = new ApplicationFacade(key);
            return instanceMap[key] as ApplicationFacade;
		}

		public function startup (system:System) : void
		{
			sendNotification(STARTUP, system);
		}

		override protected function initializeController () : void
		{
			super.initializeController();
			registerCommand(STARTUP, StartupCommand);
		}
	}
}